package com.example.myapplication;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class MainActivity extends AppCompatActivity {

    private TextView textView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        ChartCircleWaterView chartCircleWaterView = findViewById(R.id.zpc);
        textView = findViewById(R.id.tvZPCFilterElementPercentage);
        PropertyPairsBean propertyPairsBean = new PropertyPairsBean(80, R.color.abnormal_status);
        chartCircleWaterView.setItem(propertyPairsBean);
        findViewById(R.id.set10).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                PropertyPairsBean propertyPairsBean = new PropertyPairsBean(10, R.color.bbbb);
                textView.setText("10%");
                chartCircleWaterView.setItem(propertyPairsBean);
            }
        });
        findViewById(R.id.set50).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                PropertyPairsBean propertyPairsBean = new PropertyPairsBean(50, R.color.normal_status);
                textView.setText("50%");
                chartCircleWaterView.setItem(propertyPairsBean);
            }
        });
        findViewById(R.id.set100).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                textView.setText("100%");
                PropertyPairsBean propertyPairsBean = new PropertyPairsBean(100, R.color.aaa);
                chartCircleWaterView.setItem(propertyPairsBean);
            }
        });

    }
}